The present invention relates to the detection of whether a predetermined number of events have or have not occurred within a sliding time window.
In many types of systems and apparatuses, it is often desired to detect whether a predefined number of events have taken place within a certain amount of time relative to one another. Once that condition is detected, it is often also desired to detect whether a predefined number of events are no longer occurring within a certain amount of time relative to one another. Typically, in response to each of these conditions being fulfilled/not fulfilled, a corresponding change of state or certain action is invoked.
FIG. 1 is an exemplary timing diagram illustrating occurrences of some event (depicted as solid black boxes) over some period of time. In this example, it is assumed that it is desired to detect when four events take place within a certain amount of time relative to one another. That condition is satisfied within the sliding time window 101. In response to detecting that the condition is satisfied, some action, “x”, is invoked 103.
FIG. 2 is an exemplary timing diagram illustrating the situation in which it is desired to detect when it is no longer the case that four events are taking place within a certain amount of time relative to one another. In this example, that situation occurs within the sliding time window 201. In response to detecting that the condition is satisfied, some action, “y”, is invoked 203.
In order to avoid a trigger-happy system, a hysteresis timer is sometimes added. FIG. 3 depicts the same situation as in FIG. 2, but here it is not desired to take action “y” immediately. Rather, a hysteresis timer is added for making sure that the system is stable over some time period 301 before taking action “y”. Thus, attention is focused on a sliding time window within which a certain number of events should or should not occur (depending upon what condition is being tested). To implement the hysteresis, the start and stop points of the window of time are effectively moved, and the desired condition tested, at each of the number of points within a hysteresis time period. In FIG. 3, the condition of four events not occurring within the defined window of time is true and stable over the hysteresis time period 301. Consequently, action “y” is invoked 303.
A similar hysteresis timer could be added in those situations where it is desired to detect the occurrence of a predetermined number of events within a time window. FIG. 4 illustrates the case in which it is desired to detect that four events have taken place within a certain sliding time window, and that this condition is stable during a hysteresis time period before taking action. In this example, no action is taken because the condition is not fulfilled during the hysteresis time period.
In many systems, the length of the sliding time window as well as the number of events described above are fully configurable and can be altered at any time. To take the field of telecommunications as one example, the problem of detecting the occurrence/nonoccurrence of events arises when it is necessary to detect when the block error rate at the time of reception exceeds or falls below a certain threshold within a certain sliding time window.
Another example is when one wants to solve the Hierarchical Cell Structure (HCS) problem found in 3GPP Technical Specification 25.304. In this specification, it is requested that a user equipment (UE) be able to detect whether the number of cell reselections during a time period (T) exceeds a certain preconfigured amount (N). If so, then high-mobility has been detected. In this high-mobility state, the UE shall among other things, prioritize reselection of neighboring cells on a lower HCS priority level before neighboring cells on the same HCS priority level. When the number of cell reselections during the time period (T) no longer exceeds N, the UE shall continue these measurements during a time period THyst, and then revert to low-mobility measurement rules. In this example, a cell reselection is an event, T is the duration of a sliding time window within which N events must be detected, and THyst is the hysteresis timer for leaving the high-mobility state.
In order to solve problems like those mentioned above, the software solutions typically implement a sliding window as follows: The system is continuously awakened at periodic intervals by either an external program/device or by a timer that was started by the program itself. At each awakening, the sliding time window is shifted and the number of events/absence of events is counted within the sliding time window to decide whether to take an action. Additional timer supervision is required if hysteresis timers are to be used.
Such solutions have certain associated problems. For example, a system may have to constantly start timers, resulting in several timers running in parallel. Each timer timeout event results in processing to detect whether a given condition is satisfied. The faster one wants to detect whether a condition is fulfilled/not fulfilled, and the faster one wants to react and take an action, the more frequent (and finer resolution) the wake-up calls have to be. This results in more signaling, either from the external program/device or from the self-started timers, and an increased likelihood of more process switches.